<template>
	<view v-for="(item,index) in list" :key="index" class="item" @click="handleClick(item)">
		<text>{{item.areaName}}</text>
	</view>
</template>

<script setup>
	import {
		storeCity
	} from '@/api'
	import {
		onLoad,
	} from '@dcloudio/uni-app'
	import {
		ref
	} from 'vue';
	const list = ref()
	onLoad(() => {
		getData()
	})
	const getData = async () => {
		const res = await storeCity()
		list.value = res.result
	}
	const handleClick = (item)=>{
		uni.$emit('city',item)
		uni.navigateBack()
	}
</script>

<style lang="scss">
	.item{
		height: 110rpx;
		width: 690rpx;
		margin: 0 auto;
		border-bottom:2rpx solid #ccc;
		text{
			line-height: 110rpx;
			font-size: 30rpx;
			color: #333;
		}
	}
</style>